using AdminApiTemplate.Api.Enums;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;

namespace AdminApiTemplate.Api.Helpers
{
    /// <summary>
    /// 添加接口日志
    /// </summary>
    public class AddApiLogRequest
    {
        /// <summary>
        /// 每次请求的标识
        /// </summary>
        [MaxLength(50)]
        [Description("每次请求的标识")]
        public string RequestId { get; set; }

        /// <summary>
        /// 请求方式 POST/GET
        /// </summary>
        [MaxLength(10)]
        [Description("请求方式 POST/GET")]
        public string HttpMethod { get; set; }

        /// <summary>
        /// 接口地址
        /// </summary>
        [Description("接口地址")]
        [MaxLength(50)]
        public string Url { get; set; }

        /// <summary>
        /// 耗时（ms）
        /// </summary>
        [Description("耗时（ms）")]
        public long? CostTime { get; set; }

        /// <summary>
        /// 是否成功
        /// </summary>
        [Description("是否成功")]
        public bool? Success { get; set; }

        /// <summary>
        /// URL参数
        /// </summary>
        [Description("URL参数")]
        [MaxLength(200)]
        public string QueryString { get; set; }

        /// <summary>
        /// 请求参数
        /// </summary>
        [Description("请求参数")]
        [MaxLength(200)]
        public string Request { get; set; }

        /// <summary>
        /// 请求参数Hash
        /// </summary>
        [Description("请求参数Hash")]
        [MaxLength(100)]
        public string RequestHash { get; set; }

        /// <summary>
        /// 响应参数
        /// </summary>
        [Description("请求参数")]
        [MaxLength(500)]
        public string Response { get; set; }

        /// <summary>
        /// 错误信息
        /// </summary>
        [Description("错误信息")]
        [MaxLength(1000)]
        public string Error { get; set; }

        /// <summary>
        /// UserAgent
        /// </summary>
        [Description("UserAgent")]
        [MaxLength(500)]
        public string UserAgent { get; set; }

        /// <summary>
        /// IP
        /// </summary>
        [Description("IP")]
        [MaxLength(100)]
        public string IP { get; set; }

        /// <summary>
        /// 用户类型
        /// </summary>
        public SysUserTypeEnum UserType { get; set; }

        /// <summary>
        /// 用户Id
        /// </summary>
        public string UserId { get; set; }
    }
}
